﻿<local:DocumentBase x:Class="WPFExcelReport.YGRVV20"
                    xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
                    xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
                    xmlns:local="clr-namespace:ReflectionStudio.Components.UserControls;assembly=ReflectionStudio.Core"
                    xmlns:db="clr-namespace:INTEX.DataBase" 
                    Loaded="Window_Loaded" 
                       xmlns:DR="clr-namespace:WPFExcelReport;assembly=TDRAUFTR" 
                    xmlns:Localization="clr-namespace:Localization;assembly=Localization"
                    xmlns:ucd="clr-namespace:ReflectionStudio.Controls;assembly=ReflectionStudio.Controls"
                    Background="White" 
                    >
    <local:DocumentBase.Resources>
        <ucd:Divideby10  x:Key="d10"/>
        <ucd:Divideby100  x:Key="d100"/>
        <ucd:MaskPrice  x:Key="dprice"/>
        <ucd:Divideby1000  x:Key="d1000"/>
        <ucd:Divideby10000  x:Key="d10000"/>
        <ucd:GB2312Convert8859P1  x:Key="gb2312"/>
        <ucd:String2ColorConverter  x:Key="str2color"/>
        <ucd:PNumConverter  x:Key="pnum"/>
        <ucd:TextTrimmingConverter  x:Key="Trim"/>
        <db:SETINTEXDB  x:Key="SetMaster" />
        <db:SETINTEXDB  x:Key="SetDetail" />
        <db:SETINTEXDB  x:Key="SetEnv" />
        <CollectionViewSource  x:Key="vwEvents" Source="{Binding Path=ICC_WFEVENTS,Source={StaticResource SetDetail}}" />
        <CollectionViewSource   x:Key="vwMaster" Source="{Binding Path=VVLIEF,Source={StaticResource SetMaster}}" />
        <CollectionViewSource   x:Key="vwDetail" Source="{Binding Path=VVLIEF,Source={StaticResource SetDetail}}" />
        <CollectionViewSource   x:Key="vwVKKOPF" Source="{Binding Path=VKKOPF,Source={StaticResource SetMaster}}" /> 
   </local:DocumentBase.Resources>
    <Grid>
        <Grid.RowDefinitions>
            <RowDefinition Height="Auto"></RowDefinition>
            <RowDefinition Height="Auto" ></RowDefinition>
            <RowDefinition Height="1*" ></RowDefinition>
        </Grid.RowDefinitions>
        <Grid.ColumnDefinitions>
            <ColumnDefinition Width="1*"></ColumnDefinition>
            <ColumnDefinition Width="1*"></ColumnDefinition>
        </Grid.ColumnDefinitions> 
        <StackPanel Grid.Row="1" Grid.Column="0" Grid.ColumnSpan="2">
            <WrapPanel Name="ZoneOrder">
                <Grid HorizontalAlignment="Left" VerticalAlignment="Top">
                    <Grid.ColumnDefinitions>
                        <ColumnDefinition Width="Auto" />
                        <ColumnDefinition Width="Auto" />
                    </Grid.ColumnDefinitions>
                    <Grid.RowDefinitions>
                        <RowDefinition Height="Auto" />
                    </Grid.RowDefinitions>
                    <Label Content="客户号:" Grid.Column="0" Grid.Row="0" HorizontalAlignment="Left" Margin="3" VerticalAlignment="Center" />
                    <TextBlock Grid.Column="1" Grid.Row="0" Height="23" HorizontalAlignment="Left" Margin="3" 
                                                                 Text="{Binding Path=VKKKUNDNR, Source={StaticResource ResourceKey=vwVKKOPF}}" VerticalAlignment="Center" Width="80" />
                </Grid>
                <TextBlock Width="Auto">订单号:</TextBlock>
                <TextBox   Name="txtVKPAUFKRS" MaxLength="2" Width="40" Margin="10,0,0,0"  HorizontalAlignment="Left" Background="Pink"  CharacterCasing="Upper" TabIndex="11" />
                <TextBox   Name="txtVKPAUFLFD" MaxLength="6" Width="80" Margin="0,0,0,0"  HorizontalAlignment="Left" KeyUp="txtVKPAUFLFD_KeyUp" />
                <TextBox   Name="txtVKPAUFPOS" MaxLength="6" Width="40" Margin="0,0,0,0"  HorizontalAlignment="Left" />
         
                <Grid HorizontalAlignment="Left" VerticalAlignment="Top">
                    <Grid.ColumnDefinitions>
                        <ColumnDefinition Width="Auto" />
                        <ColumnDefinition Width="Auto" />
                    </Grid.ColumnDefinitions>
                    <Grid.RowDefinitions>
                        <RowDefinition Height="Auto" />
                    </Grid.RowDefinitions>
                    <Label Content="发货条件:" Grid.Column="0" Grid.Row="0" HorizontalAlignment="Left" Margin="3" VerticalAlignment="Center" />
                    <TextBlock Grid.Column="1" Grid.Row="0" Height="23" HorizontalAlignment="Left" Margin="3" Text="{Binding Path=VKKLIEFBED, Source={StaticResource ResourceKey=vwVKKOPF}}" VerticalAlignment="Center" Width="40" />
                </Grid>
                <Grid HorizontalAlignment="Left" VerticalAlignment="Top">
                    <Grid.ColumnDefinitions>
                        <ColumnDefinition Width="Auto" />
                        <ColumnDefinition Width="Auto" />
                    </Grid.ColumnDefinitions>
                    <Grid.RowDefinitions>
                        <RowDefinition Height="Auto" />
                    </Grid.RowDefinitions>
                    <Label Content="结算方式:" Grid.Column="0" Grid.Row="0" HorizontalAlignment="Left" Margin="3" VerticalAlignment="Center" />
                    <TextBlock Grid.Column="1"  Name="txtPayment" Width="80" />
                </Grid>
                <Grid HorizontalAlignment="Left" VerticalAlignment="Top">
                    <Grid.ColumnDefinitions>
                        <ColumnDefinition Width="Auto" />
                        <ColumnDefinition Width="Auto" />
                    </Grid.ColumnDefinitions>
                    <Grid.RowDefinitions>
                        <RowDefinition Height="Auto" />
                    </Grid.RowDefinitions>
                    <Label Content="运输方式:" Grid.Column="0" Grid.Row="0" HorizontalAlignment="Left" Margin="3" VerticalAlignment="Center" />
                    <TextBlock Grid.Column="1" Grid.Row="0" Height="23" HorizontalAlignment="Left" Margin="3" Text="{Binding Path=VKKVERSART, Source={StaticResource ResourceKey=vwVKKOPF}}" VerticalAlignment="Center" Width="40" />
                </Grid>
         
                <Grid HorizontalAlignment="Left" VerticalAlignment="Top">
                    <Grid.ColumnDefinitions>
                        <ColumnDefinition Width="Auto" />
                        <ColumnDefinition Width="Auto" />
                    </Grid.ColumnDefinitions>
                    <Grid.RowDefinitions>
                        <RowDefinition Height="Auto" />
                    </Grid.RowDefinitions>
                    <Button  Content="已付款" Grid.Column="0" Grid.Row="0" HorizontalAlignment="Left" Margin="3" VerticalAlignment="Center" />                    
                    <TextBlock Grid.Column="1" Grid.Row="0" Height="22" HorizontalAlignment="Left" Margin="2,0,0,0" 
                             Text="{Binding Path=VKKKOMENGE, Source={StaticResource ResourceKey=vwVKKOPF}, Converter={StaticResource ResourceKey=d100}}" 
                             VerticalAlignment="Center" Width="80" />
                </Grid> 
                <Grid HorizontalAlignment="Left" VerticalAlignment="Top">
                    <Grid.ColumnDefinitions>
                        <ColumnDefinition Width="Auto" />
                        <ColumnDefinition Width="Auto" />
                    </Grid.ColumnDefinitions>
                    <Grid.RowDefinitions>
                        <RowDefinition Height="Auto" />
                    </Grid.RowDefinitions>
                    <Label Content="销售合同:" Grid.Column="0" Grid.Row="0" HorizontalAlignment="Left" Margin="3" VerticalAlignment="Center" />
                    <TextBlock Grid.Column="1" Grid.Row="0" Height="22" HorizontalAlignment="Left" Margin="2,4,0,8" Text="{Binding Path=VKKBESTNR, Source={StaticResource ResourceKey=vwVKKOPF}}" VerticalAlignment="Center" Width="80" />
                </Grid>
                <Grid HorizontalAlignment="Left" VerticalAlignment="Top">
                    <Grid.ColumnDefinitions>
                        <ColumnDefinition Width="Auto" />
                        <ColumnDefinition Width="Auto" />
                    </Grid.ColumnDefinitions>
                    <Grid.RowDefinitions>
                        <RowDefinition Height="Auto" />
                    </Grid.RowDefinitions>
                    <Label Content="合同金额:" Grid.Column="0" Grid.Row="0" HorizontalAlignment="Left" Margin="3" VerticalAlignment="Center" />
                    <TextBlock Grid.Column="1" Grid.Row="0" Height="22" HorizontalAlignment="Left" Margin="0,0,0,0" Text="{Binding Path=VKKGESWERT, Source={StaticResource ResourceKey=vwVKKOPF}}" VerticalAlignment="Center" Width="60" />
                </Grid>
            </WrapPanel>
            <WrapPanel>               
            </WrapPanel>
        </StackPanel> 
        <TabControl   Grid.Row="2" Grid.Column="0" Grid.ColumnSpan="2"> 
      <TabItem Header="组织出货">
                    <Grid>
                        <Grid.RowDefinitions>
                            <RowDefinition Height="Auto"></RowDefinition>
                            <RowDefinition Height="1*"></RowDefinition>
                        <RowDefinition Height="Auto"></RowDefinition>
                    </Grid.RowDefinitions>
                    <Grid.ColumnDefinitions>
                        <ColumnDefinition Width="Auto"></ColumnDefinition>
                        <ColumnDefinition Width="1*"></ColumnDefinition>
                    </Grid.ColumnDefinitions>
                    <StackPanel Grid.Row="0" Grid.ColumnSpan="2">
                        <WrapPanel >
                            <TextBlock FontSize="14" VerticalAlignment="Center" Text="{Binding Source={Localization:TranslateExtension Word=重新准备}}"></TextBlock>
                            <Button  Height="30"  Width="30" Margin="10,0,0,0" Click="ResetList" KeyboardNavigation.TabIndex="3" IsDefault="True" TabIndex="13">
                                <Button.Background>
                                    <ImageBrush ImageSource="Images/Reload.png" />
                                </Button.Background>
                            </Button>

                            <TextBlock FontSize="14" VerticalAlignment="Center" Text="{Binding Source={Localization:TranslateExtension Word=创建日期范围}}"></TextBlock>
                            <TextBox FontSize="14" Name="txtDel" VerticalAlignment="Center" Width="Auto">20140909</TextBox>
                            <TextBox FontSize="14" Name="txtDEnd" VerticalAlignment="Center" Width="Auto">20140909</TextBox>
                            <TextBlock FontSize="14" VerticalAlignment="Center" Text="{Binding Source={Localization:TranslateExtension Word=运输编号}}"></TextBlock>
                            <TextBlock FontSize="14" Text="{Binding Path=VVAVISNR, Source={StaticResource ResourceKey=vwMaster},Converter={StaticResource ResourceKey=pnum}}"  VerticalAlignment="Center" Width="100"/>
                            <TextBlock FontSize="14" VerticalAlignment="Center" Text="{Binding Source={Localization:TranslateExtension Word=发货数量}}"></TextBlock>
                            <TextBlock FontSize="14" Name="txtDQty" Text="0"  VerticalAlignment="Center" Width="100"/>
                            <TextBlock Text="仓库已确认" VerticalAlignment="Center"></TextBlock>
                            <CheckBox FontSize="12" Name="ChkVV20"   Margin="10,0,0,0" HorizontalAlignment="Right">
                                <CheckBox.LayoutTransform>
                                    <ScaleTransform ScaleX="2" ScaleY="2" />
                                </CheckBox.LayoutTransform>
                            </CheckBox>  
                            <Button  Height="30"  Width="30" Margin="10,0,0,0" Click="QueryYGRVV20" KeyboardNavigation.TabIndex="3" IsDefault="True" TabIndex="13">
                                <Button.Background>
                                    <ImageBrush ImageSource="Images/Search.png" />
                                </Button.Background>
                            </Button>
                            <TextBlock FontSize="14" VerticalAlignment="Center" Text="{Binding Source={Localization:TranslateExtension Word=查询}}"></TextBlock>
                            <Button  Height="30"  Width="30" Margin="10,0,0,0" Click="Add2List" KeyboardNavigation.TabIndex="3" IsDefault="True" TabIndex="13">
                                <Button.Background>
                                    <ImageBrush ImageSource="Images/Add.png" />
                                </Button.Background>
                            </Button>
                            <TextBlock FontSize="14" VerticalAlignment="Center" Text="{Binding Source={Localization:TranslateExtension Word=加入}}"></TextBlock>
                        </WrapPanel>
                        <WrapPanel>
                            <TextBlock Text="快递单号" VerticalAlignment="Center"></TextBlock>
                            <TextBox Name="VVSEQUNO" Text="{Binding Path=VVSEQUNO, Source={StaticResource ResourceKey=vwDetail}, Converter={StaticResource ResourceKey=gb2312}}"  Width="150"  VerticalAlignment="Center"></TextBox>
                            <TextBlock Text="司机姓名和联系方式"  VerticalAlignment="Center"></TextBlock>
                            <TextBox Name="VVORTU"  Text="{Binding Path=VVORTU, Source={StaticResource ResourceKey=vwDetail}, Converter={StaticResource ResourceKey=gb2312}}" Width="200"  VerticalAlignment="Center"></TextBox>
                            <TextBlock Text="车牌号"  VerticalAlignment="Center"></TextBlock>
                            <TextBox Name="VVBZBEZU" Text="{Binding Path=VVBZBEZU, Source={StaticResource ResourceKey=vwDetail}, Converter={StaticResource ResourceKey=gb2312}}"  Width="100"  VerticalAlignment="Center"></TextBox>
                            <TextBlock FontSize="14" VerticalAlignment="Center" Text="{Binding Source={Localization:TranslateExtension Word=确认}}" ></TextBlock>
                            <Button  Margin="10,0,0,0" Click="SaveVV08" TabIndex="15"  Width="30" Height="30">
                                <Button.Background>
                                    <ImageBrush ImageSource="Images/Save.png" />
                                </Button.Background>
                            </Button>
                            <Button  Margin="10,0,0,0" Click="PrintYGRVV20" TabIndex="15"  Width="30" Height="30">
                                <Button.Background>
                                    <ImageBrush ImageSource="Images/Excel.jpg" />
                                </Button.Background>
                            </Button>
                            <Grid Margin="10,0,0,0" >
                                <Grid.ColumnDefinitions>
                                    <ColumnDefinition Width="Auto"></ColumnDefinition>
                                    <ColumnDefinition Width="Auto"></ColumnDefinition>
                                    <ColumnDefinition Width="Auto"></ColumnDefinition>
                                    <ColumnDefinition Width="Auto"></ColumnDefinition>
                                </Grid.ColumnDefinitions>
                                <DR:TDRAUFTR  Grid.Column="0" Name="cDR"  PrintType="OpenExcel" />
                                <Button  Grid.Column="1"  Click="PrintQCCommand" Height="20" Margin="5,0,0,0" Width="Auto" Content="打印质检单" />
                                <TextBlock  Grid.Column="2" Text="明细:"></TextBlock>
                                <CheckBox   Grid.Column="3" Margin="0,0,0,0" Name="AVGVV20" ></CheckBox>

                            </Grid>
                        </WrapPanel>
                    </StackPanel>
                       
                    <DataGrid    Grid.Row="1" Grid.Column="0"
                              AutoGenerateColumns="False"
                              EnableRowVirtualization="False"
                              ItemsSource="{Binding Source={StaticResource ResourceKey=vwDetail}}"  
                              HeadersVisibility="Column"
                              x:Name="dlgDetail"    
                              Height="Auto"
                              HorizontalScrollBarVisibility="Auto"
                              VerticalScrollBarVisibility="Auto" 
                              >
                        <DataGrid.Columns>
                            <DataGridTextColumn Binding="{Binding Path=VVAVISNR,Converter={StaticResource ResourceKey=pnum}}" Header="运输编号"   Width="Auto"  />
                            <DataGridTextColumn Binding="{Binding Path=VVLIEFSCH,Converter={StaticResource ResourceKey=pnum}}" Header="发货单"   Width="Auto"  />
                            <!--DataGridTextColumn Binding="{Binding Path=VVEINZBRUT, Converter={StaticResource ResourceKey=d100}}" Header="数量" Width="Auto" /-->
                            <DataGridTextColumn Binding="{Binding Path=VVBRUTTO, Converter={StaticResource ResourceKey=d100}}" Header="数量" Width="Auto" />
                        </DataGrid.Columns>
                    </DataGrid>
                    <DataGrid   
                        Margin="10,0,0,0"
                            Grid.Row="1" Grid.Column="1"
                              AutoGenerateColumns="False"
                             EnableRowVirtualization="False"
                              ItemsSource="{Binding Source={StaticResource ResourceKey=vwMaster}}"  
                              HeadersVisibility="Column"
                              x:Name="dlgMaster"    
                              Height="Auto"
                            FontSize="12"
                              HorizontalScrollBarVisibility="Auto"
                              VerticalScrollBarVisibility="Auto" 
                            RowDetailsVisibilityMode="Visible"
                              >
                        <DataGrid.RowDetailsTemplate>
                            <DataTemplate>
                                <StackPanel Orientation="Horizontal" Margin="5">
                                    <TextBlock>包装:</TextBlock>
                                    <TextBlock Foreground="CadetBlue" FontSize="16"                         
                            Text="{Binding Path=GPABEM, Converter={StaticResource ResourceKey=gb2312}}"/>
                                    <TextBlock>纱批:</TextBlock>
                                    <TextBlock Foreground="CadetBlue" FontSize="16"                             
                            Text="{Binding Path=GPAFBPART, Converter={StaticResource ResourceKey=Trim}}"/>
                                    <TextBlock>合同号</TextBlock>
                                    <TextBlock Foreground="Red" FontSize="16"                             
                            Text="{Binding Path=VKKBESTNR, Converter={StaticResource ResourceKey=Trim}}"/>
                                    <TextBlock>申购单:</TextBlock>
                                    <TextBlock Foreground="Red" FontSize="16"                             
                            Text="{Binding Path=VKPKDKOMM, Converter={StaticResource ResourceKey=Trim}}"/>

                                </StackPanel>
                            </DataTemplate>
                        </DataGrid.RowDetailsTemplate>
                        <DataGrid.Columns>
                            <DataGridTextColumn Binding="{Binding Path=VKPWUTERM}" Header="交货日期"  Width="Auto" />
                            <DataGridTextColumn Binding="{Binding Path=VKPLIEFTERM}" Header="交期"  Width="Auto" />
                            <DataGridTextColumn Binding="{Binding Path=VVAVISNR,Converter={StaticResource ResourceKey=pnum}}" Header="运输编号"   Width="Auto"  />
                            <DataGridTextColumn Binding="{Binding Path=VVLIEFSCH,Converter={StaticResource ResourceKey=pnum}}" Header="发货单"   Width="Auto"  />
                            <DataGridTextColumn Binding="{Binding Path=KDKNAME,Converter={StaticResource ResourceKey=gb2312}}" Header="客户"   Width="Auto"  />
                            <DataGridTextColumn Binding="{Binding Path=VVADRSLL}" Header="地址编号"   Width="Auto"  />
                            <DataGridTextColumn Binding="{Binding Path=PACKNR}" Header="箱数"   Width="Auto"  />
                            <DataGridTextColumn Binding="{Binding Path=VVKG}" Header="净重"   Width="Auto"  />
                            <DataGridTextColumn Binding="{Binding Path=VKPAUFKRS}"   Header=""  Width="Auto"  />
                                <DataGridTextColumn Binding="{Binding Path=VKPAUFLFD,Converter={StaticResource ResourceKey=pnum}}" Header="销售单"   Width="Auto"  />
                            <DataGridTextColumn Binding="{Binding Path=VKPAUFPOS,Converter={StaticResource ResourceKey=pnum}}"    Width="Auto"  /> 
                            <DataGridTextColumn Binding="{Binding Path=VKPMENGE1}" Header="合同重量"   Width="Auto"  />
                                <DataGridTextColumn Binding="{Binding Path=VKPART}" Header="品种"   Width="Auto"  />
                                <DataGridTextColumn Binding="{Binding Path=VKPFARBE}" Header="色号"   Width="Auto"  />  
                            </DataGrid.Columns>
                        </DataGrid> 
                    </Grid> 
                </TabItem> 
            <TabItem Header="承运人信息">
         
            </TabItem>
        </TabControl>  
    </Grid>
</local:DocumentBase>